﻿Imports System.Text

Module MiscFunctions
	Public Function DecToHex(ByVal decValue As Integer) As String
		Dim hexValue As String

		hexValue = decValue.ToString("X")
		Return "0x" & hexValue.PadLeft(4, "0")
	End Function

	Public Function hexToString(ByVal hexValue As String) As String
		Dim allHex As String()
		Dim noteString As New StringBuilder

		allHex = hexValue.Split("-")

		For Each hex As String In allHex
			noteString.Append(Convert.ToChar(Convert.ToInt32(hex)))
		Next

		Return noteString.ToString
	End Function
End Module
